class IDestroyable:
    """ Interface for the objects that can suffer damage"""
    def __init__(self,iHP):
        self.__HPMax=iHP
        self.__HP=iHP
        
        
    def setHPMax(self, iHPMax):
        """ Maximum number of hitpoints that this object can have"""
        self.__HPMax=iHPMax

    def RemainingHP(self):
        return self.__HP

    def DamageLevel(self):
        """ Percentage of hitpoints left"""
        return self.__HP/self.__HPMax
    

    def Inflict(self, iDamage):
        self.__HP = self.__-iDamage
        

    def Repair(self, iAmount):
        self.__HP = self.__HP+iAmount
        if self.__HP >= self.__HPMax :
            self.__HP = self.__HPMax
            return True
        return False

class ITimerUpdatable:
    
    def timerUpdate(self, iTimeInterval):
        """ The usual function a supervisor calls at given time intervals.
        Usually used to update position and animate objects...
        If returns False, the main loop stops."""
        return True
  
class ISelectable:
    def getSelected(self)  :
        if not self.__selected :
            self.___selected=False
        return self.__selected
    
    def setSelected(self, value):
        self.__selected=value
        
    Selected=property(getSelected,setSelected)
